#import "RNHistoryDetailHeader.h"
#import "RNConstants.h"

@interface RNHistoryDetailHeader (RNHistoryDetailHeaderPrivateMethods)
-(void)bindControllerWithEntityName_:(NSString *)entityName withPredicate:(NSPredicate *)thePredicate inManagedObjectContext:(NSManagedObjectContext *)moc;
@end

@implementation RNHistoryDetailHeader

+(NSArray *)arrayOfHeadersWithRootObject:(id)rootObject filteredWithObject:(id)filterObject inManagedObjectContext:(NSManagedObjectContext *)moc {
    RNHistoryDetailHeader *header1 = [[RNHistoryDetailHeader alloc] initWithRootObject:nil];
    [header1 setHeaderHeight:RNEmptyHeaderHeight];
    return [NSArray arrayWithObjects:header1, nil];
}

-(id)initWithRootObject:(id)rootObject {
    if (!(self = [super initWithRootObject:rootObject]))
        return nil;
    
    NSArrayController *controller = [self primaryController];
    [controller setEntityName:RNEntityNameHistoryItem];
    [controller setAutomaticallyRearrangesObjects:YES];
    [controller setManagedObjectContext:[[NSApp delegate] managedObjectContext]];
    [controller prepareContent];

    return self;
}

@end
